package cn.javase.base.multithread._04_定时任务;

import java.util.Timer;
import java.util.TimerTask;

public class _定时任务 {
    public static void main(String[] args) {
        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                System.out.println("Hello World!");
            }
        };
        timer.schedule(task, 0, 1000);
    }
}
